<?php
session_start();
//echo $_SESSION['us'];
//echo $_SESSION['ps'];
//session_destroy();
$_SESSION['username']= $_SESSION['us'];
$_SESSION['passs']= $_SESSION['ps'];
$_SESSION['usernamess']=$_SESSION['usernames'];
$_SESSION['passss']=$_SESSION['passss'];
$_SESSION['emailss']=$_SESSION['emails'];
$_SESSION['nrpss']=$_SESSION['nrps'];
$_SESSION['labss']= $_SESSION['labs'];

if(!$_SESSION['username']){
	
	header ("location:index.php");
}

?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-Groupware sisfor</title>
<meta name="description" content="Medical website">
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style5 {color: #DEDEDE}
-->
</style>
</head>

<body>
<table width="750" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
  <tr>
    <td><img src="images/logo.jpg" width="750" height="204"></td>
  </tr>
  
  <tr>
    <td height="100%"><table width="750" height="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="100%" valign="top"><table width="490" height="420" border="1">
          <tr>
            <td width="106" height="179"><p>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                <param name="movie" value="button12.swf">
                <param name="quality" value="high">
                <embed src="button12.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
              </object>
            </p>
              <p>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22" title="PROFIL">
                  <param name="BGCOLOR" value="">
                  <param name="movie" value="button3.swf">
                  <param name="quality" value="high">
                  <embed src="button3.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                </object>
</p>
              <p>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                  <param name="movie" value="button9.swf">
                  <param name="quality" value="high">
                  <embed src="button9.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                </object>
              </p>
              <p>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                  <param name="movie" value="button10.swf">
                  <param name="quality" value="high">
                  <embed src="button10.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                </object>
              </p>
              <p>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                  <param name="BGCOLOR" value="">
                  <param name="movie" value="button7.swf">
                  <param name="quality" value="high">
                  <embed src="button7.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                </object>
              </p>
              <p align="center">
			  <a href="logout.php">Logout</a>
            <td width="368"><table width="50" align="center">
      <tr>
        <th scope="row">
		<?php
/* paging_dinamis.php */

require_once "koneksi.php";

echo "<form action=\"$PHP_SELF\" method=\"GET\">";
echo "<p align=center> <b>Perlihatkan :</b>
      <select name='batas'>
         <option value='1'>1
		<option value='3'>3
        <option value='5'>5
        <option value='10'>10
        <option value='20'>20
      </select>&nbsp;";
echo "<input type=submit value='Halaman'></p>";
echo "</form>";

$flname=basename($PHP_SELF);

$res = mysql_query("SELECT * FROM berita ORDER BY id ");

$jml = @mysql_num_rows($res);
if ($jml == 0) {
    echo "<font color=red>
          <b>Ooops.... Data Tidak Ditemukan</b></font>";
    exit;
}

// Inisialisasi nilai default batas per halaman
if (isset($_GET["batas"])) {
    $batas  = $_GET["batas"];
} else {
    $batas = 1;  
}

if (($jml % $batas) == 0) {
    $jmlpage=(int)($jml/$batas);
} else {
    $jmlpage=((int)$jml/$batas)+1;
}

// Inisialisasi variabel page 
if (isset($_GET["page"])) {
    $page  = $_GET["page"];
} else {
   $page = 1;  
}

if ($page>$jmlpage) {
    $page = $jmlpage;
}

while ($rows = mysql_fetch_array($res)) {
    $arrdata[] = $rows;
}
$end  = ($page*$batas)-1;
$start= $end-($batas-1);
if ($end > $jml) {
    $end = $jml-1;
}
for ($i=$start; $i<=$end; $i++) {
     $arr[] = $arrdata[$i];
}
$b = $res[kategori];{		
	if ($b=='1')
echo "<p align=left> <b> -->  Menampilkan $batas file dari total $jml file</b></p>";
echo "<table width=630 style='border:0pt solid #666666;'>";
foreach ($arr as $row) {
    echo "
	<tr>
	<td>
		<font color='#FF0000' size=6px ><b>$row[1]</b></font>
		<br>
		<br align=left> <font color='#FFFF00'<b>Isi  </b> </font>     	: <font color='#FFFFFF'<b>$row[2]</b></font>
		<br>
	</td>
	</tr>"; 
}
}
echo "</table> <br>";

// Mengatur navigasi halaman
for ($n=1; $n<=$jmlpage; $n++) {
  $b = $page + 1;
  if ($n != $page) {
      echo "&nbsp;<a href='$flname?page=$n&batas=$batas'>
            $n</a>&nbsp;";
  } else {
      echo "<font color='#660000' size=5px ><b>$n </b></font>"; 
  }   
}

// Navigasi halaman berikutnya
if (($n != $page) && ($n > $b)) {
    echo "&nbsp;<a href='$flname?page=$b&batas=$batas'>
          Berikutnya</a>";
}

// Navigasi halaman sebelumnya
?>		</th>
      </tr>
    </table></td>
          </tr>
        </table></td>
        <td width="262" height="100%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="r-title"> </td>
          </tr>
          <tr>
            <td width="261" height="100%" bgcolor="#666666" class="r-cont"><p align="center">&nbsp;</p>
			</p>
              <p align="center">              </p>
              <p align="center" class="style5"><?php
include'clock.php';
?>
<?php
include'cal.php';
?></p>
              <p align="center" class="style5">&nbsp;</p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="1" bgcolor="#b3b5a8" class="bottom-menu">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" class="bottom_addr">&nbsp;</td>
  </tr>
</table>

</body>
</html>
